<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('撤回待分发到下级工单')"/>
    <link th:href="@{/ajax/libs/bootstrap-switch/bootstrap-switch.min.css}" rel="stylesheet">
    <link th:href="@{/ajax/libs/bootstrap-tagsinput/tagsinput.css}" rel="stylesheet">
</head>
<style>
    .bootstrap-tagsinput > input {
        display: none;
    }
     label {
         font-weight: bold;
     }

    @font-face {
        font-family: 'huawen';
        src: url("/fonts/huawen.woff2");
    }
</style>s

<body style="background-color: #F4F6FA; font-size: 13px;font-family:'huawen' ;font-weight: bold">
<iframe id="showWorkForm" width="100%" scrolling="no" th:src="@{'/system/mMailWF/cmnFile/showWorkForm/'+${sendBackEty.wfId}}" frameborder="0" seamless></iframe>
<div class="main-content" style="margin: 0;padding: 0">

    <form id="form-user-add" th:object="${sendBackEty}" class="form-horizontal" style="background-color: #F4F6FA">
        <input type="hidden" th:field="*{wfId}"/>
        <input type="hidden" th:field="*{pkId}"/>
        <input type="hidden" id="sortCode" th:field="*{sortCode}"/>
        <input type="hidden" th:field="*{sdeptName}"/>
<!--        <input type="hidden" th:field="*{sdeptId}"/>-->
        <input type="hidden" id="crtUserRole" th:value="${user.roles.get(0).roleId}"/>
        <input type="hidden" name="crtStepId" id="crtStepId" value="400"/>
        <input type="hidden" name="crtStepName" id="crtStepName" value="市级主办处理中"/>

        <div class="col-sm-12" style="display: flex">
            <div class="col-sm-12 entering-page">
                <!--    撤回已退回的工单    -->
                <div class="col-sm-12 tltieBoder">
                    <div class="blueBorder"></div>
                    <h4 style="margin:0 0 0 10px;color: blue">撤回待分发到下级工单（后续由本部门处理）</h4>
                </div>
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-3 control-label entering-pd">后续处理：</label>
                        <div class="col-sm-6">
                            <label class="check-box" id="toThis">
                                <input name="sendState" value="21" type="radio" checked>由本单位处理
                            </label>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-3 control-label entering-pd">完成期限：</label>
                        <div class="col-sm-3">
                            <input name="backLimit" th:field="*{backLimit}" placeholder="请输入"
                                   class="form-control code"
                                   type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label entering-pd">联系电话：</label>
                        <div class="col-sm-3">
                            <!--                            th:field="*{tbGetPerTel}"-->
                            <input name="getPerTel" th:value="${user.phonenumber}" placeholder="请输入"
                                   class="form-control code"
                                   type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-3 control-label entering-pd">备注：</label>
                        <div class="col-sm-6">
                            <input name="backRemark" th:field="*{backRemark}" placeholder="请输入"
                                   class="form-control scene" type="text">
                        </div>
                    </div>
                </div>
                <!--按钮-->
                <div class="col-sm-12" style="display: flex;justify-content: space-around;margin-bottom: 10px;">
                    <div class="form-group">
                        <div class="col-sm-3" style="display: flex;justify-content: space-around;margin:10px 0px 10px 0px">
                            <button type="button" class="btn btn-sm btn-success" onclick="recall()">撤回</button>&nbsp;&nbsp;&nbsp;&nbsp;
                            <button type="button" class="btn btn-sm btn-light" onclick="closeItem()">关闭</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<script th:src="@{/ajax/libs/layui/laydate.js}"></script>
<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/bootstrap-tagsinput/tagsinput.min.js}"></script>
<script th:src="@{/ajax/libs/jQuery-ui/jquery-ui.js}"></script>
<script th:src="@{/js/extension.js}"></script>

<script>
    var prefix = ctx + "system/mMailWF";

    $("#showWorkForm").on("load",function(){//iframe加载完后 高度自适应。
        var showWorkForm = document.getElementById("showWorkForm").contentDocument || document.getElementById("showWorkForm").contentWindow.document,
            frame_height = showWorkForm.documentElement.scrollHeight;
        $("#showWorkForm").height(frame_height);
    });

    //提交撤回
    function recall(){
        var sortCode = $("#sortCode").val(); //11Main 21assist
        var stepRoles = "210,240,260,290,310,340";
        var crtRole = $("#crtUserRole").val();
        if(stepRoles.indexOf(crtRole) > -1){
            if("11"!=sortCode){
                $("#crtStepId").val("400");
                $("#crtStepName").val("市级协办处理中");
            }
            else{
                $("#crtStepId").val("400");
                $("#crtStepName").val("市级主办处理中");
            }
        }
        else{ //三级不驱动流程
            if("11"!=sortCode){
                $("#crtStepId").val("400");
                $("#crtStepName").val("区（市）县协办处理中");
            }
            else{
                $("#htbNextID").val("400");
                $("#crtStepName").val("区（市）县主办处理中");
            }
        }

        if ($.validate.form()) {
            let url = prefix + "/cmnFile/dlRegetS";
            let data = $('#form-user-add').serializeArray();
            $.operate.saveTab(url,data);
        }
    }

    $(function() {
        var deptNo = ""+[[${user.getDeptId()}]]+"";
        if (deptNo.length < 7) {
            if(6==deptNo.length){
                if("301"!=deptNo.substr(0,3)&&"304"!=deptNo.substr(0,3)){
                    $("#toLower").hide();
                }
            }
        }else{
            $('#toLower').hide();
        }
    })


</script>
</body>
</html>

